package com.jl.jlapp.adapter;

import android.support.annotation.LayoutRes;
import android.support.annotation.Nullable;
import android.util.Log;
import android.view.View;
import android.widget.CheckBox;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;

import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.jl.jlapp.R;
import com.jl.jlapp.eneity.ShoppingCartModel;

import java.util.ArrayList;
import java.util.List;

public class ShopCartListAdapter
        extends BaseQuickAdapter<ShoppingCartModel.ResultDataBean, BaseViewHolder> {
    public Integer checkAddOrReduce = Integer.valueOf(-1);
    public boolean checkAll = false;
    public Integer checkedChooseGoodsSpecPopIndex = Integer.valueOf(-1);
    public List<ShoppingCartModel.ResultDataBean> checkedGoodsList = new ArrayList();
    public String checkedGoodsSpec = "";
    List<ShoppingCartModel.ResultDataBean.GoodsDetailsBean.GoodsActivitysBeanX> goodsHasActivity;
    public boolean isCheckEditBtn = false;

    public ShopCartListAdapter(@LayoutRes int paramInt, @Nullable List<ShoppingCartModel.ResultDataBean> paramList) {
        super(paramInt, paramList);
    }

    protected void convert(BaseViewHolder paramBaseViewHolder, ShoppingCartModel.ResultDataBean paramResultDataBean) {
        TextView localTextView1 = (TextView) paramBaseViewHolder.getView(R.id.shop_cart_list_item_delete);
        TextView localTextView2 = (TextView) paramBaseViewHolder.getView(R.id.shop_cart_list_item_no_goods);
        TextView localTextView3 = (TextView) paramBaseViewHolder.getView(R.id.shop_cart_list_item_goods_name);
        TextView localTextView4 = (TextView) paramBaseViewHolder.getView(R.id.shop_cart_list_item_goods_specifiction);
        TextView localTextView5 = (TextView) paramBaseViewHolder.getView(R.id.shop_cart_list_item_goods_money_unit);
        TextView localTextView6 = (TextView) paramBaseViewHolder.getView(R.id.shop_cart_list_item_goods_money);
        TextView localTextView7 = (TextView) paramBaseViewHolder.getView(R.id.shop_cart_list_item_leavings_stock);
        RelativeLayout localRelativeLayout1 = (RelativeLayout) paramBaseViewHolder.getView(R.id.shop_cart_activity_item);
        RelativeLayout localRelativeLayout2 = (RelativeLayout) paramBaseViewHolder.getView(R.id.shop_cart_list_item_change_num);
        CheckBox localCheckBox = (CheckBox) paramBaseViewHolder.getView(R.id.shop_cart_list_item_checkbox);
        RelativeLayout localRelativeLayout3 = (RelativeLayout) paramBaseViewHolder.getView(R.id.shop_cart_choose_goods_spec_btn);
        TextView localTextView8 = (TextView) paramBaseViewHolder.getView(R.id.shop_cart_edit_goods_spec);
        TextView localTextView9 = (TextView) paramBaseViewHolder.getView(R.id.shop_cart_goods_buy_num);
        TextView localTextView10 = (TextView) paramBaseViewHolder.getView(R.id.goods_spec_strock);
        TextView localTextView11 = (TextView) paramBaseViewHolder.getView(R.id.shop_cart_activity_type);
        TextView localTextView12 = (TextView) paramBaseViewHolder.getView(R.id.goods_activity_content);
        TextView localTextView13 = (TextView) paramBaseViewHolder.getView(R.id.goods_activity_more_info);
        TextView localTextView14 = (TextView) paramBaseViewHolder.getView(R.id.shop_cart_list_item_goods_old_money);
        TextView localTextView15 = (TextView) paramBaseViewHolder.getView(R.id.tv_reduce);
        TextView localTextView16 = (TextView) paramBaseViewHolder.getView(R.id.tv_add);
        TextView localTextView17 = (TextView) paramBaseViewHolder.getView(R.id.shop_cart_list_item_undercarriage);
        int n = -1;
        int m = -1;
        int k = -1;
        int i1 = -1;
        int j = -1;
        this.goodsHasActivity = new ArrayList();
        localTextView1.setVisibility(View.GONE);
        localRelativeLayout1.setVisibility(View.GONE);
        localTextView2.setVisibility(View.GONE);
        localTextView17.setVisibility(View.GONE);
        localRelativeLayout2.setVisibility(View.VISIBLE);
        localTextView7.setVisibility(View.GONE);
        localTextView3.setTextColor(paramBaseViewHolder.itemView.getResources().getColor(R.color.trans_333333));
        localTextView4.setTextColor(paramBaseViewHolder.itemView.getResources().getColor(R.color.trans_333333));
        localTextView5.setTextColor(paramBaseViewHolder.itemView.getResources().getColor(R.color.trans_333333));
        localTextView6.setTextColor(paramBaseViewHolder.itemView.getResources().getColor(R.color.trans_333333));
        localTextView4.setVisibility(View.VISIBLE);
        localRelativeLayout3.setVisibility(View.GONE);
        localCheckBox.setVisibility(View.VISIBLE);
        localCheckBox.setChecked(false);
        localCheckBox.setEnabled(true);
        localCheckBox.setButtonDrawable(paramBaseViewHolder.itemView.getResources().getDrawable(R.drawable.checkbox_style));
        localTextView14.setVisibility(View.GONE);
        int i = 0;
        while (i < this.checkedGoodsList.size()) {
            if (paramResultDataBean.getId() == ((ShoppingCartModel.ResultDataBean) this.checkedGoodsList.get(i)).getId()) {
                localCheckBox.setChecked(true);
            }
            i += 1;
        }
        if (this.checkAll) {
            localCheckBox.setChecked(true);
        }
        ImageView ivGood = (ImageView) paramBaseViewHolder.getView(R.id.shop_cart_list_item_goods_img);
        Glide.with(paramBaseViewHolder.itemView.getContext()).asBitmap().apply(new RequestOptions().placeholder(R.drawable.img_noimg_xs).error(R.drawable.img_lose_xs)).load("http://117.158.178.202:8001/JLMIS/" + paramResultDataBean.getGoodsPicUrl()).into(ivGood);
        paramBaseViewHolder.setText(R.id.shop_cart_list_item_goods_name, paramResultDataBean.getGoodsName());
        paramBaseViewHolder.setText(R.id.shop_cart_list_item_goods_specifiction, paramResultDataBean.getGoodsSpecificationDetailsName());
        paramBaseViewHolder.setText(R.id.shop_cart_list_item_goods_money, paramResultDataBean.getGoodsUnitlPrice() + "");
        if ((paramResultDataBean.getGoodsDetails() != null) && (paramResultDataBean.getGoodsDetails().getGoodsSpecificationDetails().size() > 0)) {
            int i2 = 0;
            i = i1;
            if (i2 < paramResultDataBean.getGoodsDetails().getGoodsSpecificationDetails().size()) {
                i1 = i;
                int i3 = j;
                int i4 = k;
                int i5 = m;
                int i6 = n;
                if (((ShoppingCartModel.ResultDataBean.GoodsDetailsBean.GoodsSpecificationDetailsBean) paramResultDataBean.getGoodsDetails().getGoodsSpecificationDetails().get(i2)).getId() == paramResultDataBean.getGoodsSpecificationDetailsId()) {
                    if ((paramResultDataBean.getGoodsDetails().getGoodsActivitys().size() != 0) || (((ShoppingCartModel.ResultDataBean.GoodsDetailsBean.GoodsSpecificationDetailsBean) paramResultDataBean.getGoodsDetails().getGoodsSpecificationDetails().get(i2)).getGoodsActivitys().size() != 0)) {
                    }
                    localRelativeLayout1.setVisibility(View.GONE);
                    if (paramResultDataBean.getState() == 0) {
                    }
                    localTextView17.setVisibility(View.VISIBLE);
                    localRelativeLayout2.setVisibility(View.GONE);
                    localTextView3.setTextColor(paramBaseViewHolder.itemView.getResources().getColor(R.color.font_grey));
                    localTextView4.setTextColor(paramBaseViewHolder.itemView.getResources().getColor(R.color.font_grey));
                    localTextView5.setTextColor(paramBaseViewHolder.itemView.getResources().getColor(R.color.font_grey));
                    localTextView6.setTextColor(paramBaseViewHolder.itemView.getResources().getColor(R.color.font_grey));
                    localCheckBox.setEnabled(false);
                    localCheckBox.setChecked(false);
                    localCheckBox.setButtonDrawable(paramBaseViewHolder.itemView.getResources().getDrawable(R.drawable.icon_checkbox_disable2));
                    localRelativeLayout1.setVisibility(View.GONE);
                    paramBaseViewHolder.setText(R.id.shop_cart_edit_goods_spec, ((ShoppingCartModel.ResultDataBean.GoodsDetailsBean.GoodsSpecificationDetailsBean) paramResultDataBean.getGoodsDetails().getGoodsSpecificationDetails().get(i2)).getSpecifications());
                    paramBaseViewHolder.setText(R.id.goods_spec_strock, ((ShoppingCartModel.ResultDataBean.GoodsDetailsBean.GoodsSpecificationDetailsBean) paramResultDataBean.getGoodsDetails().getGoodsSpecificationDetails().get(i2)).getGxcGoodsStock() + "");
                    paramBaseViewHolder.setText(R.id.shop_cart_goods_buy_num, paramResultDataBean.getGoodsNum() + "");
                    if (paramResultDataBean.getGoodsNum() <= 1) {
                    }
                    localTextView15.setTextColor(paramBaseViewHolder.itemView.getResources().getColor(R.color.trans_333333));
                    if (paramResultDataBean.getGoodsNum() < ((ShoppingCartModel.ResultDataBean.GoodsDetailsBean.GoodsSpecificationDetailsBean) paramResultDataBean.getGoodsDetails().getGoodsSpecificationDetails().get(i2)).getGxcGoodsStock()) {
                    }
                    if ((paramResultDataBean.getGoodsDetails().getZeroStock().intValue() != 0) || (((ShoppingCartModel.ResultDataBean.GoodsDetailsBean.GoodsSpecificationDetailsBean) paramResultDataBean.getGoodsDetails().getGoodsSpecificationDetails().get(i2)).getGxcGoodsState() != 2)) {
                    }
                    localTextView16.setTextColor(paramBaseViewHolder.itemView.getResources().getColor(R.color.moreText));
                    if (paramResultDataBean.getGoodsNum() >= 500) {
                        localTextView16.setTextColor(paramBaseViewHolder.itemView.getResources().getColor(R.color.moreText));
                    }
                    if (this.isCheckEditBtn) {
                        localRelativeLayout1.setVisibility(View.GONE);
                        if (paramResultDataBean.getState() != 0) {
                            localCheckBox.setVisibility(View.GONE);
                            localTextView1.setVisibility(View.GONE);
                        }
                        if ((((ShoppingCartModel.ResultDataBean.GoodsDetailsBean.GoodsSpecificationDetailsBean) paramResultDataBean.getGoodsDetails().getGoodsSpecificationDetails().get(i2)).getGxcGoodsStock() <= 0) && (paramResultDataBean.getGoodsDetails().getZeroStock().intValue() == 0) && (((ShoppingCartModel.ResultDataBean.GoodsDetailsBean.GoodsSpecificationDetailsBean) paramResultDataBean.getGoodsDetails().getGoodsSpecificationDetails().get(i2)).getGxcGoodsState() == 2)) {
                            localCheckBox.setVisibility(View.VISIBLE);
                            localTextView1.setVisibility(View.VISIBLE);
                        }
                        if (((ShoppingCartModel.ResultDataBean.GoodsDetailsBean.GoodsSpecificationDetailsBean) paramResultDataBean.getGoodsDetails().getGoodsSpecificationDetails().get(i2)).getGxcGoodsStock() > 0) {
                        }
                        if ((paramResultDataBean.getGoodsDetails().getZeroStock().intValue() != 0) || (((ShoppingCartModel.ResultDataBean.GoodsDetailsBean.GoodsSpecificationDetailsBean) paramResultDataBean.getGoodsDetails().getGoodsSpecificationDetails().get(i2)).getGxcGoodsState() != 2)) {
                        }
                        localTextView4.setVisibility(View.VISIBLE);
                        localRelativeLayout3.setVisibility(View.GONE);
                        if (paramBaseViewHolder.getLayoutPosition() == this.checkedChooseGoodsSpecPopIndex.intValue()) {
                            localTextView8.setText(this.checkedGoodsSpec);
                        }
                    }
                    i1 = i;
                    i3 = j;
                    i4 = k;
                    i5 = m;
                    i6 = n;
                    if (paramBaseViewHolder.getLayoutPosition() == this.checkedChooseGoodsSpecPopIndex.intValue()) {
                        if (this.checkAddOrReduce.intValue() != 0) {
                        }
                        if ("".equals(localTextView9.getText().toString().trim())) {
                        }
                        int localObject = Integer.valueOf(Integer.parseInt(localTextView9.getText().toString().trim()));
                        if (((Integer) localObject).intValue() == 1) {
                        }
                        Toast.makeText(paramBaseViewHolder.itemView.getContext(), "不能再减少了!", Toast.LENGTH_SHORT).show();

                    }
                } else {
                    localRelativeLayout1.setVisibility(View.VISIBLE);
                    if (((ShoppingCartModel.ResultDataBean.GoodsDetailsBean.GoodsSpecificationDetailsBean) paramResultDataBean.getGoodsDetails().getGoodsSpecificationDetails().get(i2)).getGxcGoodsState() == 1) {
                        String localObject = paramResultDataBean.getActivityName();
                        localTextView11.setText("预售");
                        localTextView12.setText("已参加预售活动：" + (String) localObject);
                        localTextView13.setVisibility(View.GONE);
                    }
                    if (paramResultDataBean.getGoodsDetails().getGoodsActivitys().size() > 0) {
                        i1 = 0;
                        while (i1 < paramResultDataBean.getGoodsDetails().getGoodsActivitys().size()) {
                            this.goodsHasActivity.add(paramResultDataBean.getGoodsDetails().getGoodsActivitys().get(i1));
                            i1 += 1;
                        }
                    }
                    if (((ShoppingCartModel.ResultDataBean.GoodsDetailsBean.GoodsSpecificationDetailsBean) paramResultDataBean.getGoodsDetails().getGoodsSpecificationDetails().get(i2)).getGoodsActivitys().size() > 0) {
                        i1 = 0;
                        while (i1 < ((ShoppingCartModel.ResultDataBean.GoodsDetailsBean.GoodsSpecificationDetailsBean) paramResultDataBean.getGoodsDetails().getGoodsSpecificationDetails().get(i2)).getGoodsActivitys().size()) {
                            ShoppingCartModel.ResultDataBean.GoodsDetailsBean.GoodsSpecificationDetailsBean.GoodsActivitysBean localObject = (ShoppingCartModel.ResultDataBean.GoodsDetailsBean.GoodsSpecificationDetailsBean.GoodsActivitysBean) ((ShoppingCartModel.ResultDataBean.GoodsDetailsBean.GoodsSpecificationDetailsBean) paramResultDataBean.getGoodsDetails().getGoodsSpecificationDetails().get(i2)).getGoodsActivitys().get(i1);
                            ShoppingCartModel.ResultDataBean.GoodsDetailsBean.GoodsActivitysBeanX localGoodsActivitysBeanX = new ShoppingCartModel.ResultDataBean.GoodsDetailsBean.GoodsActivitysBeanX();
                            localGoodsActivitysBeanX.setId(((ShoppingCartModel.ResultDataBean.GoodsDetailsBean.GoodsSpecificationDetailsBean.GoodsActivitysBean) localObject).getId());
                            localGoodsActivitysBeanX.setGoodsId(((ShoppingCartModel.ResultDataBean.GoodsDetailsBean.GoodsSpecificationDetailsBean.GoodsActivitysBean) localObject).getGoodsId());
                            localGoodsActivitysBeanX.setGoodsSpecificationDetails(((ShoppingCartModel.ResultDataBean.GoodsDetailsBean.GoodsSpecificationDetailsBean.GoodsActivitysBean) localObject).getGoodsSpecificationDetails());
                            localGoodsActivitysBeanX.setState(((ShoppingCartModel.ResultDataBean.GoodsDetailsBean.GoodsSpecificationDetailsBean.GoodsActivitysBean) localObject).getState());
                            ShoppingCartModel.ResultDataBean.GoodsDetailsBean.GoodsActivitysBeanX.ActivityInformationBeanX localActivityInformationBeanX = new ShoppingCartModel.ResultDataBean.GoodsDetailsBean.GoodsActivitysBeanX.ActivityInformationBeanX();
                            localActivityInformationBeanX.setId(((ShoppingCartModel.ResultDataBean.GoodsDetailsBean.GoodsSpecificationDetailsBean.GoodsActivitysBean) localObject).getActivityInformation().getId());
                            localActivityInformationBeanX.setIdentifier(((ShoppingCartModel.ResultDataBean.GoodsDetailsBean.GoodsSpecificationDetailsBean.GoodsActivitysBean) localObject).getActivityInformation().getIdentifier());
                            localActivityInformationBeanX.setName(((ShoppingCartModel.ResultDataBean.GoodsDetailsBean.GoodsSpecificationDetailsBean.GoodsActivitysBean) localObject).getActivityInformation().getName());
                            localActivityInformationBeanX.setActivityType(((ShoppingCartModel.ResultDataBean.GoodsDetailsBean.GoodsSpecificationDetailsBean.GoodsActivitysBean) localObject).getActivityInformation().getActivityType());
                            localActivityInformationBeanX.setPrice(((ShoppingCartModel.ResultDataBean.GoodsDetailsBean.GoodsSpecificationDetailsBean.GoodsActivitysBean) localObject).getActivityInformation().getPrice());
                            localActivityInformationBeanX.setDiscount(((ShoppingCartModel.ResultDataBean.GoodsDetailsBean.GoodsSpecificationDetailsBean.GoodsActivitysBean) localObject).getActivityInformation().getDiscount());
                            localActivityInformationBeanX.setMaxNum(((ShoppingCartModel.ResultDataBean.GoodsDetailsBean.GoodsSpecificationDetailsBean.GoodsActivitysBean) localObject).getActivityInformation().getMaxNum());
                            localActivityInformationBeanX.setBeginValidityTime(((ShoppingCartModel.ResultDataBean.GoodsDetailsBean.GoodsSpecificationDetailsBean.GoodsActivitysBean) localObject).getActivityInformation().getBeginValidityTime());
                            localActivityInformationBeanX.setEndValidityTime(((ShoppingCartModel.ResultDataBean.GoodsDetailsBean.GoodsSpecificationDetailsBean.GoodsActivitysBean) localObject).getActivityInformation().getEndValidityTime());
                            localGoodsActivitysBeanX.setActivityInformation(localActivityInformationBeanX);
                            this.goodsHasActivity.add(localGoodsActivitysBeanX);
                            i1 += 1;
                        }
                    }

                    localTextView13.setVisibility(View.GONE);
                    if (this.goodsHasActivity.size() > 1) {
                        localTextView13.setVisibility(View.VISIBLE);
                    }
                    if (n != -1) {
                        localTextView11.setText("折扣");
                        localTextView12.setText("打 " + ((ShoppingCartModel.ResultDataBean.GoodsDetailsBean.GoodsActivitysBeanX) this.goodsHasActivity.get(n)).getActivityInformation().getDiscount() * 10.0D + " 折，最多可购买" + ((ShoppingCartModel.ResultDataBean.GoodsDetailsBean.GoodsActivitysBeanX) this.goodsHasActivity.get(n)).getActivityInformation().getMaxNum() + "个");
                    } else {
                        localTextView14.getPaint().setFlags(16);
                        i = i1;
                        if (m != -1) {
                            localTextView11.setText("团购");
                            localTextView12.setText("团购单价为¥" + ((ShoppingCartModel.ResultDataBean.GoodsDetailsBean.GoodsActivitysBeanX) this.goodsHasActivity.get(m)).getActivityInformation().getDiscount() + "，最多可购买" + ((ShoppingCartModel.ResultDataBean.GoodsDetailsBean.GoodsActivitysBeanX) this.goodsHasActivity.get(m)).getActivityInformation().getMaxNum() + "个");
                        } else if (k != -1) {
                            localTextView11.setText("秒杀");
                            localTextView12.setText("秒杀单价为¥" + ((ShoppingCartModel.ResultDataBean.GoodsDetailsBean.GoodsActivitysBeanX) this.goodsHasActivity.get(k)).getActivityInformation().getDiscount() + "，最多可购买" + ((ShoppingCartModel.ResultDataBean.GoodsDetailsBean.GoodsActivitysBeanX) this.goodsHasActivity.get(k)).getActivityInformation().getMaxNum() + "个");
                        } else if (i1 != -1) {
                            localTextView11.setText("立减");
                            localTextView12.setText("购买可立减¥" + ((ShoppingCartModel.ResultDataBean.GoodsDetailsBean.GoodsActivitysBeanX) this.goodsHasActivity.get(i1)).getActivityInformation().getDiscount() + "，最多可购买" + ((ShoppingCartModel.ResultDataBean.GoodsDetailsBean.GoodsActivitysBeanX) this.goodsHasActivity.get(i1)).getActivityInformation().getMaxNum() + "个");
                        } else if (j != -1) {
                            localTextView11.setText("满减");
                            localTextView12.setText("该商品满¥" + ((ShoppingCartModel.ResultDataBean.GoodsDetailsBean.GoodsActivitysBeanX) this.goodsHasActivity.get(j)).getActivityInformation().getPrice() + "，可减¥" + ((ShoppingCartModel.ResultDataBean.GoodsDetailsBean.GoodsActivitysBeanX) this.goodsHasActivity.get(j)).getActivityInformation().getDiscount());
                        }
                    }
                    localTextView17.setVisibility(View.GONE);
                    if ((((ShoppingCartModel.ResultDataBean.GoodsDetailsBean.GoodsSpecificationDetailsBean) paramResultDataBean.getGoodsDetails().getGoodsSpecificationDetails().get(i2)).getGxcGoodsStock() <= 0) && (paramResultDataBean.getGoodsDetails().getZeroStock().intValue() == 0) && (((ShoppingCartModel.ResultDataBean.GoodsDetailsBean.GoodsSpecificationDetailsBean) paramResultDataBean.getGoodsDetails().getGoodsSpecificationDetails().get(i2)).getGxcGoodsState() == 2)) {
                        localTextView2.setVisibility(View.VISIBLE);
                        localRelativeLayout2.setVisibility(View.GONE);
                        localTextView3.setTextColor(paramBaseViewHolder.itemView.getResources().getColor(R.color.font_grey));
                        localTextView4.setTextColor(paramBaseViewHolder.itemView.getResources().getColor(R.color.font_grey));
                        localTextView5.setTextColor(paramBaseViewHolder.itemView.getResources().getColor(R.color.font_grey));
                        localTextView6.setTextColor(paramBaseViewHolder.itemView.getResources().getColor(R.color.font_grey));
                        localCheckBox.setEnabled(false);
                        localCheckBox.setChecked(false);
                        localCheckBox.setButtonDrawable(paramBaseViewHolder.itemView.getResources().getDrawable(R.drawable.icon_checkbox_disable2));
                        localRelativeLayout1.setVisibility(View.GONE);
                    }
                    if ((((ShoppingCartModel.ResultDataBean.GoodsDetailsBean.GoodsSpecificationDetailsBean) paramResultDataBean.getGoodsDetails().getGoodsSpecificationDetails().get(i2)).getGxcGoodsStock() <= 0) || (((ShoppingCartModel.ResultDataBean.GoodsDetailsBean.GoodsSpecificationDetailsBean) paramResultDataBean.getGoodsDetails().getGoodsSpecificationDetails().get(i2)).getGxcGoodsStock() >= 5) || (paramResultDataBean.getGoodsDetails().getZeroStock().intValue() != 0) || (((ShoppingCartModel.ResultDataBean.GoodsDetailsBean.GoodsSpecificationDetailsBean) paramResultDataBean.getGoodsDetails().getGoodsSpecificationDetails().get(i2)).getGxcGoodsState() != 2)) {
                    }
                    localTextView7.setVisibility(View.VISIBLE);
                    localTextView7.setText("仅剩" + ((ShoppingCartModel.ResultDataBean.GoodsDetailsBean.GoodsSpecificationDetailsBean) paramResultDataBean.getGoodsDetails().getGoodsSpecificationDetails().get(i2)).getGxcGoodsStock() + "件");
                    localTextView15.setTextColor(paramBaseViewHolder.itemView.getResources().getColor(R.color.moreText));
                    localTextView16.setTextColor(paramBaseViewHolder.itemView.getResources().getColor(R.color.trans_333333));
                    localTextView16.setTextColor(paramBaseViewHolder.itemView.getResources().getColor(R.color.trans_333333));
                    localTextView4.setVisibility(View.GONE);
                    localRelativeLayout3.setVisibility(View.VISIBLE);
                    localTextView4.setVisibility(View.GONE);
                    localRelativeLayout3.setVisibility(View.VISIBLE);
//                    localTextView9.setText(((Integer) localObject).intValue() - 1 + "");
                    Toast.makeText(paramBaseViewHolder.itemView.getContext(), "数据有误!", Toast.LENGTH_SHORT).show();
                    if (this.checkAddOrReduce.intValue() == 1) {
                        if (!"".equals(localTextView9.getText().toString().trim())) {
                           int localObject = Integer.valueOf(Integer.parseInt(localTextView9.getText().toString().trim()));
                            i1 = Integer.parseInt(localTextView10.getText().toString().trim());
                            Log.d("aaaashopcart++", "zero:" + paramResultDataBean.getGoodsDetails().getZeroStock() + " state:" + ((ShoppingCartModel.ResultDataBean.GoodsDetailsBean.GoodsSpecificationDetailsBean) paramResultDataBean.getGoodsDetails().getGoodsSpecificationDetails().get(i2)).getGxcGoodsState());
                            if ((paramResultDataBean.getGoodsDetails().getZeroStock().intValue() == 0) && (((ShoppingCartModel.ResultDataBean.GoodsDetailsBean.GoodsSpecificationDetailsBean) paramResultDataBean.getGoodsDetails().getGoodsSpecificationDetails().get(i2)).getGxcGoodsState() == 2)) {
                                if (((Integer) localObject).intValue() >= Integer.valueOf(i1).intValue()) {
                                    Toast.makeText(paramBaseViewHolder.itemView.getContext(), "已到库存上线!", Toast.LENGTH_SHORT).show();
                                } else {
                                    localTextView9.setText(((Integer) localObject).intValue() + 1 + "");
                                }
                            } else {
                                localTextView9.setText(((Integer) localObject).intValue() + 1 + "");
                            }
                        } else {
                            Toast.makeText(paramBaseViewHolder.itemView.getContext(), "数据有误!", Toast.LENGTH_SHORT).show();
                        }
                    }
                }
            }
        } else {
            localTextView17.setVisibility(View.VISIBLE);
            localRelativeLayout2.setVisibility(View.GONE);
            localTextView3.setTextColor(paramBaseViewHolder.itemView.getResources().getColor(R.color.font_grey));
            localTextView4.setTextColor(paramBaseViewHolder.itemView.getResources().getColor(R.color.font_grey));
            localTextView5.setTextColor(paramBaseViewHolder.itemView.getResources().getColor(R.color.font_grey));
            localTextView6.setTextColor(paramBaseViewHolder.itemView.getResources().getColor(R.color.font_grey));
            localCheckBox.setEnabled(false);
            localCheckBox.setChecked(false);
            localCheckBox.setButtonDrawable(paramBaseViewHolder.itemView.getResources().getDrawable(R.drawable.icon_checkbox_disable2));
            localRelativeLayout1.setVisibility(View.GONE);
            if (this.isCheckEditBtn) {
                localRelativeLayout1.setVisibility(View.GONE);
                if (paramResultDataBean.getState() == 1) {
                    localCheckBox.setVisibility(View.GONE);
                    localTextView1.setVisibility(View.VISIBLE);
                }
            }
        }
        paramBaseViewHolder.addOnClickListener(R.id.shop_cart_list_item_checkbox);
        paramBaseViewHolder.addOnClickListener(R.id.tv_reduce);
        paramBaseViewHolder.addOnClickListener(R.id.tv_add);
        paramBaseViewHolder.addOnClickListener(R.id.shop_cart_goods_buy_num);
        paramBaseViewHolder.addOnClickListener(R.id.shop_cart_list_item_delete);
        paramBaseViewHolder.addOnClickListener(R.id.shop_cart_choose_goods_spec_btn);
        paramBaseViewHolder.addOnClickListener(R.id.goods_activity_more_info);
    }

    public void setCheckAddOrReduce(Integer paramInteger) {
        this.checkAddOrReduce = paramInteger;
    }

    public void setCheckAll(boolean paramBoolean) {
        this.checkAll = paramBoolean;
    }

    public void setCheckEditBtn(boolean paramBoolean) {
        this.isCheckEditBtn = paramBoolean;
    }

    public void setCheckedChooseGoodsSpecPopIndex(Integer paramInteger) {
        this.checkedChooseGoodsSpecPopIndex = paramInteger;
    }

    public void setCheckedGoodsList(List<ShoppingCartModel.ResultDataBean> paramList) {
        this.checkedGoodsList = paramList;
    }

    public void setCheckedGoodsSpec(String paramString) {
        this.checkedGoodsSpec = paramString;
    }
}


/* Location:              /Users/davidzhang/Documents/decompileApk/jlfood-dex2jar.jar!/com/jl/jlapp/adapter/ShopCartListAdapter.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       0.7.1
 */